/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sharepas.nf;

import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;
import sharepas.nf.*;

/**
 * Define list of method that a use by all classes in nb packages
 * @author yaiba
 */
public class SharePasNf {


    private static Logger log;


    public static Logger getSharePasLog(){
        if( log == null ){
            log = Logger.getLogger("sharePas.log");
        }
        return log;
    }



    public static Server runServer(){
        try {
            Server server = new ServerImpl();
            server.run();
            return server;
        } catch (RemoteException ex) {
            Logger.getLogger(SharePasNf.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public static Client runClient(String hostName){
        try {
            Client client = new ClientImpl(hostName);
            return client;
        } catch (RemoteException ex) {
            Logger.getLogger(SharePasNf.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

}
